import random
fall = open("name.txt","r",encoding="UTF-8")
all = fall.read()
namelist = all.split("\n")
s = len(namelist)
sed = 0
remain = 0
print("-------Python课程总人数:%d-------"%s)
print("计科1813 24 姜沭琪")
a = '1'
while a == '1':
    temp = random.choice(namelist)
    namelist.remove(temp)
    print("随机点名中：%s"%temp)
    sed += 1
    remain = s - sed
    print("已随机点名人数：%d,未点到人数：%d"%(sed,remain))


    f = open("new.txt","w",encoding="UTF-8")
    f = open("old.txt", "w", encoding="UTF-8")
    for line in namelist:
        f.write(line + '\n')

    if not namelist:
         print("点名结束")
         break
    else:
         #print(namelist)
         print("-"*31)
         a = input("是否继续点名[1继续/0结束]")
         while a != '1'and a !='0':
             a = input("请输入正确选项[0或1]")
    f.close()


